The ValueType method returns a string that specifies the data type of a named value in the registry. You can use this method, for example, to verify the existence and data type of a named value in the registry before calling a method such as Get to retrieve it.
ValueType(FullKeyValueName)
HKLM\Software\MyCompany\MyValue
The key portion of this parameter can be a key on either a local or a remote machine. Keys on a remote machine are specified by prefixing the key name with the machine name. For example:
\\RemoteMachine\HKLM\Software\MyProg
A string that specifies the data type of the named value. If the named value does not exist, an empty string ("") is returned.
<% Set Reg = Server.CreateObject("IISSample.Registry") ValueName = "HKLM\Software\MyCompany\MyValue" DataType = ValueType(ValueName) Select Case DataType Case "REG_SZ","REG_EXPAND_SZ","REG_DWORD" Error = "No Error" MyValue = Get(ValueName) Case "" Error = "Value does not exist" MyValue = "" Case Else Error = "Unsupported value type." MyValue = "" End Select If Error = "No Error" Then 'Use the value to perform operations . . . Else 'Handle the error . . . End If %>